package com.allenkerr.cloud.user.service;

import com.allenkerr.cloud.user.entity.User;
import com.allenkerr.cloud.user.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 小柯(Allen Kerr) on 17.6.13 15:00.
 */
@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    /**
     * 查找所有用户信息
     */
    public List<User> findAll() {
        return userRepository.findAll();
    }

    /**
     * 按照Id查找用户
     */
    public User findById(Long id) {
        return userRepository.findOne(id);
    }


}
